package emt.friendtracking.maps;

import emt.friendtracking.maps.org.ci.geo.route.*;

public class AnswerAccept extends AnswerTracking
{
	@SuppressWarnings("unused")
	private static final String TAG = AnswerAccept.class.getSimpleName();
	
	private String username, phoneNumber;
	private double destLongitude, destLatitude;
	private double meLongitude, meLatitude;

	public AnswerAccept(String myUsername, String phoneNumber, double destinationLongitude, double destinationLatitude, double meLongitude, double meLatitude)
	{
		this.username = myUsername;
    	this.phoneNumber = phoneNumber;
		this.destLongitude = destinationLongitude;
		this.destLatitude = destinationLatitude;
		this.meLongitude = meLongitude;
		this.meLatitude = meLatitude;
	}
	
	@Override
	public void run()
	{
		double distance = Helper.getDistance(meLongitude, meLatitude, destLongitude, destLatitude);
		super.sendAnswer(username, phoneNumber, Type.ACCEPT, Double.toString(distance));
	}
}
